package com.xbongbong.saas.help;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.util.DateTimeUtil;
import com.xbongbong.paas.toolbox.util.StringUtil;
import com.xbongbong.pro.enums.RefundStatusEnum;
import com.xbongbong.pro.enums.errorcodes.SystemErrorCodeEnum;
import com.xbongbong.saas.constant.BasicConstant;
import com.xbongbong.saas.enums.base.CommunicateBaseEnum;
import com.xbongbong.saas.enums.business.ClueEnum;
import com.xbongbong.saas.enums.business.CommunicatePlanEnum;
import com.xbongbong.saas.enums.business.ContactEnum;
import com.xbongbong.saas.enums.business.ContractEnum;
import com.xbongbong.saas.enums.business.CustomerCommunicateEnum;
import com.xbongbong.saas.enums.business.CustomerManagementEnum;
import com.xbongbong.saas.enums.business.DistributorContactEnum;
import com.xbongbong.saas.enums.business.InvoiceEnum;
import com.xbongbong.saas.enums.business.MarketActivityEnum;
import com.xbongbong.saas.enums.business.OrderEnum;
import com.xbongbong.saas.enums.business.PayPlanEnum;
import com.xbongbong.saas.enums.business.PaySheetEnum;
import com.xbongbong.saas.enums.business.PaymentEnum;
import com.xbongbong.saas.enums.business.PaymentSheetEnum;
import com.xbongbong.saas.enums.business.ProductEnum;
import com.xbongbong.saas.enums.business.ProductionOrderEnum;
import com.xbongbong.saas.enums.business.PurchaseEnum;
import com.xbongbong.saas.enums.business.PurchaseInvoiceEnum;
import com.xbongbong.saas.enums.business.QuotationEnum;
import com.xbongbong.saas.enums.business.ReturnEnum;
import com.xbongbong.saas.enums.business.SalesOpportunityEnum;
import com.xbongbong.saas.enums.business.SupplierEnum;
import com.xbongbong.saas.enums.business.TransferEnum;
import com.xbongbong.saas.enums.business.WorkReportFieldEnum;
import com.xbongbong.saas.enums.dictionary.ArchivedEnum;
import com.xbongbong.saas.enums.dictionary.OrderExpressStatusEnum;
import com.xbongbong.saas.enums.dictionary.OrderPayMentStatusEnum;
import com.xbongbong.saas.enums.dictionary.OrderStatusEnum;
import com.xbongbong.saas.enums.dictionary.OrderTypeEnum;
import com.xbongbong.saas.enums.dictionary.ReturnStatusEnum;
import com.xbongbong.saas.enums.dictionary.ReturnTypeEnum;
import com.xbongbong.saas.enums.dictionary.ShipStatusEnum;
import com.xbongbong.saas.enums.dictionary.TransferStatusEnum;

import java.util.ArrayList;
import java.util.Objects;

/**
 * saas业务数据data初始化
 * 防止逻辑字段key丢失
 * 同时赋予默认值
 * TODO 非必填的下拉存什么,空还是0
 * @author haibin.zhang
 * @version v1.0
 * @date 2019/3/4 13:56
 * @since v1.0
 */
public final class SaasDataInitHelp {
    /**
     * 设置 不能为空
     * @param data 校验数据
     * @param key 字段key
     * @param value 前端传参
     */
    public static void dataSetNotNull(JSONObject data,String key,Object value) throws XbbException{
        if (Objects.equals(value,null)){
            throw new XbbException(SystemErrorCodeEnum.API_ERROR_100001);
        }
        data.put(key,value);
    }

    /**
     * 设置
     * 只有回款单、付款单等有
     * @param data 保存数据
     * @param key 字段key
     * @param value 前端传参
     */
    public static void dataSet(JSONObject data,String key,Object value){
        if (Objects.equals(value,null)){
            return;
        }
        data.put(key,value);
    }

    /**
     * 反设置
     * @param data 校验数据
     * @param key 字段key
     * @param value 标准数据
     */
    public static void antDataSet(JSONObject data,String key,Object value){
        if (!Objects.equals(data.get(key),null)){
            return;
        }
        data.put(key,value);
    }
    public static JSONObject initPaymentSheet(){
        JSONObject data = new JSONObject();
//        data.put(PaymentSheetEnum.IS_BAD.getAttr(),0);
//        data.put(PaymentSheetEnum.IS_RED.getAttr(),0);
//        data.put(PaymentSheetEnum.FILE.getAttr(),new JSONArray());
//        data.put(PaymentSheetEnum.MEMO.getAttr(),"");
//        data.put(PaymentSheetEnum.RED_SHEET.getAttr(),0);
//        data.put(PaymentSheetEnum.ESTIMATE_TIME.getAttr(),0);
        data.put(PaymentSheetEnum.PAYMENT_TIME.getAttr(),0);
        return data;
    }

    public static JSONObject initPayment() {
        JSONObject data = new JSONObject();
        data.put(PaymentEnum.REAL_AMOUNT.getAttr(),0);
        data.put(PaymentEnum.UN_AMOUNT.getAttr(),0);
        data.put(PaymentEnum.BAD_AMOUNT.getAttr(),0);
        data.put(PaymentEnum.MEMO.getAttr(),"");
        data.put(PaymentEnum.IS_RED.getAttr(),0);
        data.put(PaymentEnum.HAS_RED.getAttr(),0);
        data.put(PaymentEnum.INVOICE_AMOUNT.getAttr(),0);
        data.put(PaymentEnum.RECEIVABLE_IS_RED.getAttr(),0);
        data.put(PaymentEnum.RECEIVABLE_HAS_RED.getAttr(),0);
        data.put(PaymentEnum.RED_AMOUNT.getAttr(),0);
        return data;
    }

    public static JSONObject initPayPlan(){
        JSONObject data = new JSONObject();
        data.put(PayPlanEnum.REAL_AMOUNT.getAttr(),0);
        data.put(PayPlanEnum.UN_AMOUNT.getAttr(),0);
        data.put(PayPlanEnum.ESTIMATE_TIME.getAttr(),0);
        data.put(PayPlanEnum.BAD_AMOUNT.getAttr(),0);
        data.put(PayPlanEnum.HAS_RED.getAttr(),0);
        data.put(PayPlanEnum.INVOICE_AMOUNT.getAttr(),0);
        return data;
    }

    public static JSONObject initPayPlanSheet(){
        JSONObject data = new JSONObject();
        data.put(PaySheetEnum.REAL_PAY_TIME.getAttr(),0);
        return data;
    }

    public static JSONObject initCommunicatePlan() {
        JSONObject data = new JSONObject();
        data.put(CommunicatePlanEnum.ORI_COMMUNICATE_TIME.getAttr(), 0);
        data.put(CommunicatePlanEnum.FINISH_TIME.getAttr(), 0);
        data.put(CommunicatePlanEnum.DELAY_CAUSE.getAttr(), "");
        data.put(CommunicatePlanEnum.DELAY_MEMO.getAttr(), "");
        return data;
    }

    public static JSONObject initOpportunity() {
        JSONObject data = new JSONObject();
        data.put(SalesOpportunityEnum.LAST_CONNECT_TIME.getAttr(), 0);
        data.put(SalesOpportunityEnum.EXCHANGE_RATE.getAttr(), 0);
        data.put(SalesOpportunityEnum.OTHER_CHARGE.getAttr(), 0);
        data.put(SalesOpportunityEnum.GROSS_PROFIT.getAttr(), 0);
        data.put(SalesOpportunityEnum.GROSS_PROFIT_RATE.getAttr(), 0);
        data.put(SalesOpportunityEnum.IMPORTANT_DEGREE.getAttr(), 0);
        data.put(SalesOpportunityEnum.ESTIMATE_AMOUNT.getAttr(),0D);
        data.put(SalesOpportunityEnum.COST.getAttr(), 0);
        data.put(SalesOpportunityEnum.IS_ARCHIVED.getAttr(), 2);
        return data;
    }

    public static JSONObject initProductionOrder() {
        JSONObject data = new JSONObject();
        data.put(ProductionOrderEnum.COMPLETE_TIME.getAttr(), 0);
        data.put(ProductionOrderEnum.PRODUCT_NUM.getAttr(), 0);
        data.put(ProductionOrderEnum.PRODUCT_INSTOCK_NUM.getAttr(), 0);
        data.put(ProductionOrderEnum.PRODUCT_UNINSTOCK_NUM.getAttr(), 0);
        data.put(ProductionOrderEnum.ALL_INCOMING.getAttr(), 0);
        data.put(ProductionOrderEnum.ALL_OUTBOUND.getAttr(), 0);
        data.put(ProductionOrderEnum.HAS_RETURNED_MATERIEL.getAttr(), 0);

        return data;
    }

    public static JSONObject initWorkReport() {
        JSONObject data = new JSONObject();
        data.put(WorkReportFieldEnum.REVIEWER.getAttr(), "[]");
        data.put(WorkReportFieldEnum.CC.getAttr(), "[]");
        data.put(WorkReportFieldEnum.CONTENT.getAttr(), "");
        data.put(WorkReportFieldEnum.IMAGE.getAttr(), "");
        return data;
    }

    public static JSONObject initContract() {
        JSONObject data = new JSONObject();
        data.put(ContractEnum.STATUS.getAttr(), "");
        data.put(ContractEnum.PAY_METHOD.getAttr(), "");
        data.put(ContractEnum.CONTRACT_COST.getAttr(), 0D);
        data.put(ContractEnum.GROSS_PROFIT.getAttr(), 0D);
        data.put(ContractEnum.GROSS_PROFIT_RATE.getAttr(), 0D);
        data.put(ContractEnum.CASH_PROFIT.getAttr(), 0D);
        data.put(ContractEnum.CASH_PROFIT_RATE.getAttr(), 0D);
        data.put(ContractEnum.FINISH_AMOUNT.getAttr(), 0D);
        data.put(ContractEnum.PAY_PERCENT.getAttr(), 0D);
        data.put(ContractEnum.INVOICE_AMOUNT.getAttr(), 0D);
        data.put(ContractEnum.IS_RED.getAttr(), 0);
        data.put(ContractEnum.IS_RED.getAttr(), 0);
        data.put(ContractEnum.HAS_RED.getAttr(), 0);
        data.put(ContractEnum.ESTIMATE_COST.getAttr(), 0D);
        data.put(ContractEnum.REAL_COST.getAttr(), 0D);
        data.put(ContractEnum.SHOW_PRODUCE.getAttr(), 0D);
        data.put(ContractEnum.AMOUNT.getAttr(), 0D);
        data.put(ContractEnum.ARCHIVED.getAttr(), 2);
        data.put(ContractEnum.PRODUCT_TOTAL.getAttr(), BasicConstant.ZERO_DOUBLE);
        data.put(ContractEnum.OTHER_EXPENSE.getAttr(), BasicConstant.ZERO_DOUBLE);
        data.put(ContractEnum.DISCOUNT_AMOUNT.getAttr(), BasicConstant.ZERO_DOUBLE);
        data.put(ContractEnum.BAD_AMOUNT.getAttr(), BasicConstant.ZERO_DOUBLE);
        return data;
    }

    public static JSONObject initQuotation() {
        JSONObject data = new JSONObject();
        data.put(QuotationEnum.STATUS.getAttr(), "");
        data.put(QuotationEnum.ARCHIVED.getAttr(), ArchivedEnum.UN_ARCHIVED.getCode());
        data.put(QuotationEnum.PRODUCT_TOTAL.getAttr(), 0D);
        data.put(QuotationEnum.OTHER_EXPENSE.getAttr(), 0D);
        data.put(QuotationEnum.DISCOUNT_AMOUNT.getAttr(), 0D);
        data.put(QuotationEnum.AMOUNT.getAttr(), 0D);
        data.put(QuotationEnum.ESTIMATE_COST.getAttr(), 0D);
        data.put(QuotationEnum.GROSS_PROFIT.getAttr(), 0D);
        data.put(QuotationEnum.GROSS_PROFIT_RATE.getAttr(), 0D);
        data.put(QuotationEnum.VERSION.getAttr(), "1.0");
        return data;
    }

    public static JSONObject initClue() {
        JSONObject data = new JSONObject();
        data.put(ClueEnum.IS_PUBLIC.getAttr(),0);
        data.put(ClueEnum.IS_ARCHIVED.getAttr(), ArchivedEnum.UN_ARCHIVED.getCode());
        data.put(ClueEnum.CLUE_STAGE.getAttr(),"");
        data.put(ClueEnum.CLUE_STATUS.getAttr(),"");
        data.put(ClueEnum.LAST_CONNECT_TIME.getAttr(),0L);
        return data;
    }

    public static JSONObject initMarketActivity() {
        JSONObject data = new JSONObject();
        data.put(MarketActivityEnum.ESTIMATE_COST.getAttr(),0);
        data.put(MarketActivityEnum.REAL_COST.getAttr(),0);
        data.put(MarketActivityEnum.ESTIMATE_INCOME.getAttr(),0);
        data.put(MarketActivityEnum.REAL_INCOME.getAttr(),0);
        return data;
    }

    public static JSONObject initInvoice(){
        JSONObject data = new JSONObject();
        data.put(InvoiceEnum.MEMO.getAttr(),"");
        data.put(InvoiceEnum.IS_RED.getAttr(),0);
        data.put(InvoiceEnum.IS_CANCEL.getAttr(),0);
        data.put(InvoiceEnum.INVOICE_DATE.getAttr(),0);
        data.put(InvoiceEnum.INVOICE_TYPE.getAttr(),"");
        data.put(InvoiceEnum.ATTACHMENTS.getAttr(),new JSONArray());
        return data;
    }

    public static JSONObject initPurchaseInvoice(){
        JSONObject data = new JSONObject();
        data.put(PurchaseInvoiceEnum.MEMO.getAttr(),"");
        data.put(PurchaseInvoiceEnum.IS_RED.getAttr(),0);
        data.put(PurchaseInvoiceEnum.IS_CANCEL.getAttr(),0);
        data.put(PurchaseInvoiceEnum.INVOICE_DATE.getAttr(),0);
        data.put(PurchaseInvoiceEnum.INVOICE_TYPE.getAttr(),"");
        data.put(PurchaseInvoiceEnum.ATTACHMENTS.getAttr(),new JSONArray());
        return data;
    }

    public static JSONObject initCustomer(){
        JSONObject data = new JSONObject();
        data.put(CustomerManagementEnum.IMPORTANT_DEGREE.getAttr(),0);
        data.put(CustomerManagementEnum.IS_PUBLIC.getAttr(),0);
        data.put(CustomerManagementEnum.IS_ARCHIVED.getAttr(), ArchivedEnum.UN_ARCHIVED.getCode());
        data.put(CustomerManagementEnum.CUSTOMER_STAGE.getAttr(),"");
        //data.put(CustomerManagementEnum.WASTAGE.getAttr(),"");
        data.put(CustomerManagementEnum.TYPE.getAttr(),"");
        data.put(CustomerManagementEnum.GENRE.getAttr(),"");
        data.put(CustomerManagementEnum.COUNTRY.getAttr(),"");
        data.put(CustomerManagementEnum.LAST_CONNECT_TIME.getAttr(),0L);
//        data.put(CustomerManagementEnum.LONGITUDE.getAttr(),0);
//        data.put(CustomerManagementEnum.LATITUDE.getAttr(),0);
        return data;
    }
    public static JSONObject initOrder(Double amount, String loginUserName){
        JSONObject data = new JSONObject();
        //新建时 状态塞默认值 是否归档，1归档，2未归档
        data.put(OrderEnum.ARCHIVED.getAttr(), ArchivedEnum.UN_ARCHIVED.getCode());
        data.put(OrderEnum.UN_FINISH_AMOUNT.getAttr(), amount);
        data.put(OrderEnum.UN_INVOICE_AMOUNT.getAttr(), amount);
        data.put(OrderEnum.SHIP_STATUS.getAttr(), ShipStatusEnum.UNSHIPPED.getCode());
        //新建订单状态为待订单审核 发货状态为代发货
        data.put(OrderEnum.STATUS.getAttr(), OrderStatusEnum.PENDING_ORDER_REVIEW.getCode());
        data.put(OrderEnum.EXPRESS_STATUS.getAttr(), OrderExpressStatusEnum.DELIVERED.getCode());
        data.put(OrderEnum.RECEIVE_PAYMENT_STATUS.getAttr(), OrderPayMentStatusEnum.PENDING_SETTLEMENT.getCode());
        //下单类型 下单人
        if (Objects.isNull(data.get(OrderEnum.TYPE.getAttr())) || StringUtil.isEmpty(data.get(OrderEnum.TYPE.getAttr()).toString())){
            data.put(OrderEnum.TYPE.getAttr(), OrderTypeEnum.VALET_ORDER.getCode());
            data.put(OrderEnum.ORDERER.getAttr(),loginUserName);
        }
        return data;
    }

    public static JSONObject initReturn(String orderer){
        JSONObject data = new JSONObject();
        data.put(ReturnEnum.ORDER_STATUS.getAttr(), ReturnStatusEnum.UNDER_REVIEW.getCode());
        data.put(ReturnEnum.REFUND_STATUS.getAttr(), RefundStatusEnum.UNREFUND.getCode());
//        data.put(ReturnEnum.DRAWBACK_STATUS.getAttr(), DrawbackStatusEnum.NO_REFUND.getCode());
        data.put(ReturnEnum.REFUND_TYPE.getAttr(), ReturnTypeEnum.VALET_RETRUN.getCode());
        data.put(ReturnEnum.ORDERER.getAttr(),orderer);
        return data;
    }
    public static JSONObject initProduct(){
        JSONObject data = new JSONObject();
        data.put(ProductEnum.PARENT_ID.getAttr(),0);
        data.put(ProductEnum.ONLINE.getAttr(),0);
        data.put(ProductEnum.SHOW_PRICE.getAttr(),0);
        data.put(ProductEnum.SHOW_COST.getAttr(),0);
        data.put(ProductEnum.ORI_STOCK.getAttr(),0);
        data.put(ProductEnum.IS_NOTIFY.getAttr(),0);
        data.put(ProductEnum.TEMP_STOCK.getAttr(),0);
        JSONObject specificationObj = new JSONObject();
        specificationObj.put("advancedMode", 0);
        specificationObj.put("singleSpec", "");
        data.put(ProductEnum.SPECIFICATION.getAttr(),specificationObj);
        data.put(ProductEnum.ONLINE.getAttr(),1);
        data.put(ProductEnum.SUPPLIER.getAttr(),new ArrayList<>());
        data.put(ProductEnum.SUPPLIER_LINK_TEXT.getAttr(),new ArrayList<>());
        data.put(ProductEnum.STOCK.getAttr(),0);
        data.put(ProductEnum.ENABLE_SKU.getAttr(),1);
        return data;
    }

    public static JSONObject initContact(){
        JSONObject data = new JSONObject();
        data.put(ContactEnum.IMPORTANT_DEGREE.getAttr(),0);
        data.put(ContactEnum.SEX.getAttr(),0);
        data.put(ContactEnum.ZIP_CODE.getAttr(),"");
        data.put(ContactEnum.DEPARTMENT.getAttr(),"");
        data.put(ContactEnum.POSITION.getAttr(),"");
        data.put(ContactEnum.EMAIL.getAttr(),"");
        data.put(ContactEnum.PHONE.getAttr(),new ArrayList<>());
//        data.put(ContactEnum.BIRTHDAY.getAttr(),0);
//        data.put(ContactEnum.BIRTHDAY_LINK_TEXT.getAttr(),0);
        data.put(ContactEnum.INTIMATE_DEGREE.getAttr(),0);
        data.put(ContactEnum.DD_CONTACT_ID.getAttr(),"");
        data.put(ContactEnum.IS_MAIN.getAttr(),0);
//        data.put(ContactEnum.LUNAR_BIRTHDAY_LINK_TEXT.getAttr(),0);
        data.put(ContactEnum.BUSINESS_CARD.getAttr(),"");
        data.put(ContactEnum.MEMO.getAttr(),"");
        return data;
    }

    public static JSONObject initCustomerCommunicate(){
        JSONObject data = new JSONObject();
        data.put(CommunicateBaseEnum.TYPE.getAttr(),0);
        data.put(CommunicateBaseEnum.COMMUNICATE_BUSINESS.getAttr(),"");
        data.put(CommunicateBaseEnum.COMMUNICATE_BUSINESS_TYPE.getAttr(),"");
        data.put(CommunicateBaseEnum.COMMUNICATE_BUSINESS_HIDE.getAttr(),"");
        data.put(CommunicateBaseEnum.MEMO.getAttr(),"");
        data.put(CommunicateBaseEnum.VIDEO.getAttr(),"");
        data.put(CommunicateBaseEnum.CONTACT.getAttr(),new JSONArray());
        data.put(CommunicateBaseEnum.COMMUNICATE_TIME.getAttr(),DateTimeUtil.getInt());
        data.put(CustomerCommunicateEnum.IF_REMIND.getAttr(), BasicConstant.ZERO);
        /*data.put(CustomerCommunicateEnum.NEXT_COMMUNICATE_TIME.getAttr(), BasicConstant.ZERO);
        data.put(CustomerCommunicateEnum.NOTIFY_TYPE.getAttr(), CommunicatePlanNotifyTypeEnum.NO_NOTIFY.getCode());
        data.put(CustomerCommunicateEnum.NOTIFY_TIME.getAttr(), BasicConstant.ZERO);*/
//        data.put(CustomerCommunicateEnum.NEXT_NOTIFY_MEMO.getAttr(), "");
        data.put(CustomerCommunicateEnum.ENTER_COMMUNICATE_PLAN.getAttr(), BasicConstant.ZERO);
        return data;
    }

    public static JSONObject initSupplierCommunicate(){
        JSONObject data = new JSONObject();
        data.put(CommunicateBaseEnum.TYPE.getAttr(),0);
        data.put(CommunicateBaseEnum.COMMUNICATE_BUSINESS.getAttr(),"");
        data.put(CommunicateBaseEnum.COMMUNICATE_BUSINESS_TYPE.getAttr(),"");
        data.put(CommunicateBaseEnum.COMMUNICATE_BUSINESS_HIDE.getAttr(),"");
        data.put(CommunicateBaseEnum.MEMO.getAttr(),"");
        data.put(CommunicateBaseEnum.VIDEO.getAttr(),"");
        data.put(CommunicateBaseEnum.CONTACT.getAttr(),new JSONArray());
        data.put(CommunicateBaseEnum.COMMUNICATE_TIME.getAttr(),DateTimeUtil.getInt());
        return data;
    }

    public static JSONObject initSupplier(){
        JSONObject data = new JSONObject();
        data.put(SupplierEnum.SHORT_NAME.getAttr(),"");
        data.put(SupplierEnum.QUALITY_STANDARD.getAttr(),0);
        data.put(SupplierEnum.MEMO.getAttr(),"");
        data.put(SupplierEnum.SUPPLY_COST.getAttr(),0);
        data.put(SupplierEnum.DELIVERY_CAPACITY.getAttr(),0);
        data.put(SupplierEnum.SERVER_CAPACITY.getAttr(),0);
        data.put(SupplierEnum.CREDIT_LEVEL.getAttr(),0);
        data.put(SupplierEnum.REGISTERED_CAPITAL.getAttr(),0);
        data.put(SupplierEnum.COUNTRY.getAttr(),"");
        data.put(SupplierEnum.WEBSITE.getAttr(),"");
        data.put(SupplierEnum.ANNUAL_OUTPUT.getAttr(),0);
        data.put(SupplierEnum.MEMO.getAttr(),"");
        data.put(SupplierEnum.PRODUCT_LIST.getAttr(),"");
        data.put(SupplierEnum.LAST_CONNECT_TIME.getAttr(),0);
        return data;
    }

    public static JSONObject initPurchase(){
        JSONObject data = new JSONObject();
        data.put(PurchaseEnum.ALL_INCOMING.getAttr(),0);
        data.put(PurchaseEnum.MEMO.getAttr(),"");
        data.put(PurchaseEnum.RETURNED_PURCHASE_ID.getAttr(), 0);
        data.put(PurchaseEnum.INSTOCK_ID.getAttr(), new ArrayList<>());
        data.put(PurchaseEnum.PRODUCT_TOTAL.getAttr(), BasicConstant.ZERO_DOUBLE);
        data.put(PurchaseEnum.DISCOUNT_MONEY.getAttr(), BasicConstant.ZERO_DOUBLE);
        data.put(PurchaseEnum.DISCOUNT_AMOUNT.getAttr(), BasicConstant.ZERO_DOUBLE);
        data.put(PurchaseEnum.BAD_AMOUNT.getAttr(), BasicConstant.ZERO_DOUBLE);
        data.put(PurchaseEnum.FINISH_AMOUNT.getAttr(), BasicConstant.ZERO_DOUBLE);
        data.put(PurchaseEnum.RECEINE_PERCENT.getAttr(), BasicConstant.ZERO);
        data.put(PurchaseEnum.INVOICE_AMOUNT.getAttr(), BasicConstant.ZERO_DOUBLE);
        return data;
    }

    public static JSONObject initTransfer(){
        JSONObject data = new JSONObject();
        data.put(TransferEnum.STATUS.getAttr(),TransferStatusEnum.WAIT_OUT_INSTOCK.getCode().toString());
        return data;
    }

    public static JSONObject initDistributorCommunicate(){
        JSONObject data = new JSONObject();
        data.put(CommunicateBaseEnum.TYPE.getAttr(),0);
        data.put(CommunicateBaseEnum.COMMUNICATE_BUSINESS.getAttr(),"");
        data.put(CommunicateBaseEnum.COMMUNICATE_BUSINESS_TYPE.getAttr(),"");
        data.put(CommunicateBaseEnum.COMMUNICATE_BUSINESS_HIDE.getAttr(),"");
        data.put(CommunicateBaseEnum.MEMO.getAttr(),"");
        data.put(CommunicateBaseEnum.VIDEO.getAttr(),"");
        data.put(CommunicateBaseEnum.CONTACT.getAttr(),new JSONArray());
        data.put(CommunicateBaseEnum.COMMUNICATE_TIME.getAttr(),DateTimeUtil.getInt());
        return data;
    }

    public static JSONObject initDistributoerContact(){
        JSONObject data = new JSONObject();
        data.put(DistributorContactEnum.IMPORTANT_DEGREE.getAttr(),0);
        data.put(DistributorContactEnum.SEX.getAttr(),0);
        data.put(DistributorContactEnum.ZIP_CODE.getAttr(),"");
        data.put(DistributorContactEnum.DEPARTMENT.getAttr(),"");
        data.put(DistributorContactEnum.POSITION.getAttr(),"");
        data.put(DistributorContactEnum.EMAIL.getAttr(),"");
        data.put(DistributorContactEnum.PHONE.getAttr(),new ArrayList<>());
//        data.put(DistributorContactEnum.BIRTHDAY.getAttr(),0);
//        data.put(DistributorContactEnum.BIRTHDAY_LINK_TEXT.getAttr(),0);
        data.put(DistributorContactEnum.INTIMATE_DEGREE.getAttr(),0);
        data.put(DistributorContactEnum.DD_CONTACT_ID.getAttr(),"");
        data.put(DistributorContactEnum.IS_MAIN.getAttr(),0);
//        data.put(DistributorContactEnum.LUNAR_BIRTHDAY_LINK_TEXT.getAttr(),0);
        data.put(DistributorContactEnum.BUSINESS_CARD.getAttr(),"");
        data.put(DistributorContactEnum.MEMO.getAttr(),"");
        return data;
    }
}
